﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace OwnZTec.LojaDelivery.UI.WinForms
{
    public partial class FrmMostraTela : OwnZForm
    {

        #region -- Membros e Construtores -------------------------------------------------------------------------------------------------

        public StringBuilder sbImprime { get; set; }

        public Form Pai { get; set; }

        public FrmMostraTela()
        {
            InitializeComponent();
        }

        #endregion

        #region -- Eventos ----------------------------------------------------------------------------------------------------------------
        private void FrmMostraTela_Load(object sender, EventArgs e)
        {
            txtImprime.Text = sbImprime.ToString();
        }

        private void btnPrint_Click(object sender, EventArgs e)
        {
            if (Pai.GetType() == typeof(FrmVendasDetalhes))
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                StringBuilder sb = new StringBuilder();
                sb.Append(txtImprime.Text);
                Impressao.Impressao imprime = new Impressao.Impressao();
                imprime.ImprimeDesperdicio(sb);
                this.Close();
            }
        }

        private void btnFechar_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        #endregion

        #region -- Metodos ----------------------------------------------------------------------------------------------------------------
        #endregion
    }
}
